﻿using System;
using System.ComponentModel;

namespace SpectrumAnalyser.ModelObjects
{
    [Serializable]
    public class ChemicalElement : INotifyPropertyChanged
    {
        public string Name { get; set; }

        /// <summary>
        /// Original Intensity From DB.
        /// </summary>
        public double OriginalIntensity { get; set; }

        public int IonizationStage { get; set; }

        private bool _isVisible { get; set; }

        public bool IsVisible
        {
            get { return _isVisible; }
            set
            {
                _isVisible = value;
                OnPropertyChanged("IsVisible");
            }
        }

        private bool _isChecked { get; set; }

        public bool IsChecked
        {
            get { return _isChecked; }
            set
            {
                _isChecked = value;
                OnPropertyChanged("IsChecked");
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}